import { get, post } from '../request'

const activity = {
  // 管理员发起一个活动
  launchActivity(param) {
    return post(
      '/activity/launch',
      param
    )
  },

  // 商店发起参加活动的申请
  applyForActivity(param) {
    return post(
      '/activity/participate-request',
      param
    )
  },

  // 管理员处理商店参加活动申请
  processApplication(param) {
    return post(
      '/activity/participate-request/process',
      param
    )
  },

  // 获取所有活动
  getPageOfAllActivity(param) {
    return get(
      '/activity/all',
      param
    )
  },

  // 获取正在进行中的活动
  getPageOfOngoingActivity(param) {
    return get(
      '/activity/ongoing',
      param
    )
  },

  // 获取活动信息
  getActivityInfo(activityId) {
    return get(
      `/activity/info/${activityId}`
    )
  },

  // 获取所有参加活动申请
  getPageOfParticipateRequest(param) {
    return get(
      '/activity/participate-request',
      param
    )
  },

  // 获取参加活动申请信息
  getParticipateRequest(storeParticipateInActivityRequestId) {
    return get(
      `/activity/participate-request/${storeParticipateInActivityRequestId}`
    )
  },

  // 获取商店的所有参加活动申请记录
  getPageOfActivityRequestOfStore(storeId, param) {
    return get(
      `/activity/participate-request/store/${storeId}`,
      param
    )
  }
}

export default activity;
